package lesson5;

public class TwoDimArrays {

		public static void main(String[] args) {
			
			int[][] array = {
					{1,2,3}, 
					{4,5,6,6,6,5}, 
					{7,8,9,3}
			};
			
			int[][] array2 = new int[4][];
			array2[0] = new int[3];
			array2[1] = new int[6];
			array2[2] = new int[2];
			array2[3] = new int[9];
				
			
			//print the matrix
			for(int i = 0; i < array2.length; i++)
			{
				for(int j = 0; j < array2[i].length; j++)
				{
					System.out.print(array2[i][j] + " ");
				}
				System.out.println();
			}
			/*
			System.out.println("The elements on main diagonal are:");
			//print the digits on main diagonal
			for(int i = 0; i < array.length; i++)
			{
				for(int j = 0; j < array[i].length; j++)
				{
					if(i == j)
						System.out.print(array[i][j] + " ");
				}
			}*/
		}
}
